package com.aote.expression.function;

import java.util.List;

/**
 * 剪除字符串后面几位函数
 */
public class CutLastFunction implements StringFunction {
	/**
	 * 执行函数
	 */
	public String invoke(String string, List params) {
		// 取出参数
		String param1 = (String) params.get(0);
		int n = Integer.parseInt(param1);
		int len = string.length();
		String result = string.substring(0, len - n);
		return result;
	}
}
